// src/reducers/index.js
import { createSlice } from '@reduxjs/toolkit';

const initialState = {
  routerUrl: 'page1',
};

const appSlice = createSlice({
  name: 'route',
  initialState,
  reducers: {
    setRouterUrl: (state, action) => {
      state.routerUrl = action.payload;
      localStorage.setItem('routerUrl', action.payload);
    }
  },
});

export const { setRouterUrl } = appSlice.actions;

export default appSlice.reducer;